<%@page language="Java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="includes/head.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Users</title>
</head>
<body>
	<span id="whole-page-wrapper">
			<div id="wrapper" align="center">
			<%@include file="includes/header.jsp" %>
			<%@include file="includes/menu.jsp" %>	
					
				<div id="content">
					<div id="inner-content">
					<c:if test="${sessionScope.user != null }">
						<c:if test="${sessionScope.user.type == 'Admin' }">
							<h3><a href="newUser.jsp">Dodaj użytkownika do bazy danych</a></h3>
						</c:if>
						<br>
						<c:if test="${sessionScope.users == null }">
							Lista użytkowników jest pusta 
						</c:if>
						<%! int i=0; %>
						<c:forEach var="user" items="${sessionScope.users}"> 
								<h3 ><a href="user.jsp?id=<%= i %>"> ${user.name} ${user.surname} </a></h3>
								<% i++; %>
							
						</c:forEach>
						<% i=0; %>	
					</c:if>
					<c:if test="${sessionScope.user == null }">
						Nie masz uprawnień do korzystania z tej strony!
					</c:if>
					</div>
				</div>
					<%@include file="includes/footer.jsp" %>
				</div>
		</span>
</body>
</html>